#!/bin/bash
cd `dirname $0`
LOG_FILE=console.log
JAR=oom-test-0.0.1-SNAPSHOT.jar
JAVA_OPTS="-Xms4g -Xmx4g -Xss256k -XX:MetaspaceSize=1g -XX:MaxMetaspaceSize=1g -XX:+UseG1GC -XX:+ExitOnOutOfMemoryError -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./ -XX:+PrintGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:+PrintHeapAtGC -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=30M -Xloggc:./gc.log"
nohup java ${JAVA_OPTS} -jar ${JAR} >> ${LOG_FILE} 2>&1 &
echo "start ${JAR}"
sleep 1
tail -f ${LOG_FILE}
